<?php

class MainView extends ArrayProcessor_Translator {
	private static $html = null;
	
	public static function getHTMLElement ()  {
		if (is_null(self::$html))  {
			self::$html = new HTML();
		}
		
		return self::$html;
	}
	
	public static function mainMenu ($data)  {
		$html = self::getHTMLElement();
		
		self::structureToFunction($html, $data, HTML_LI::HTML_LI);
		
		MainController::setGeneratedContent($html->toString(), Replacer::PLACEHOLDER_MAIN_MENU);
	}
	
	public static function mainMenuControl ($data)  {
		$html = self::getHTMLElement();
		
		self::structureToFunction($html, $data, HTML_LI::HTML_LI);
		
		MainController::setGeneratedContent($html->toString(), Replacer::PLACEHOLDER_MAIN_MENU_CONTROL);
	} 
	
	public static function subMenuFrame ()  {
		MainController::setGeneratedContent('', Replacer::PLACEHOLDER_SUB_MENU);
	}
	
	public static function textContentFrame ($data)  {
		$html = self::getHTMLElement();
		
		self::structureToFunction($html, $data, HTML_UL::HTML_UL);
		
		MainController::setGeneratedContent($html->toString(), Replacer::PLACEHOLDER_CONTENT);
	}
	
	public static function errorMessageArea ($data)  {
		$html = self::getHTMLElement();
	
		self::structureToFunction($html, $data, HTML_DIV::HTML_DIV);
	
		MainController::setGeneratedContent($html->toString(), Replacer::PLACEHOLDER_ERROR);
	}
	
}

?>